﻿
var formHtml='<form action=""  target="_blank"  id="f"  method="post">';
    formHtml+='<input  type="hidden" name="v" value ="124455567797979" />';
    formHtml+='<input   type="hidden" name="TechID" id="TechID"/>';
    formHtml+='<input   type="hidden" name="AppID" id="AppID"/>';
    formHtml+='</form>';
///左侧导航
//function leftNav(url,selItemIndex,totalItems)
//{
//  // parent.frames["mainFrame"].location=url;

////   if(selItemIndex!=null && totalItems!=null)
////   {
////      // alert(selItemIndex);
////       //alert(totalItems);
////       for(var i=1;i<=totalItems;i++)
////       {
////        
////         var obj=document.getElementById("item"+i);
////         if(obj!=null)
////         {
////            obj.className="";
////         }
////       }
////       var selObj=document.getElementById("item"+selItemIndex);
////       // selObj.className="active";
////       if(selObj!=null)
////       {
////      
////           selObj.className="active";
////       }
//       parent.frames["mainFrame"].location=url;
//   //}
//}

function getObjects(parentId, controlType) {
    var parent = document.getElementById(parentId);
    var arr = new Array();
    var cur = parent.firstChild;
    while (cur != null) {
        if (cur.type == controlType)
            arr.push(cur);
        siblingObjs(cur, controlType, arr);
        cur = cur.nextSibling;  // 遍历子节点
    }
    return arr;
}

function siblingObjs(parent, controlType, arr) {
    var cur = parent.firstChild;
    while (cur != null) {
        if (cur.type == controlType)
            arr.push(cur); 
        siblingObjs(cur, controlType, arr);       
        cur = cur.nextSibling;  // 遍历子节点
    }
    return arr;
}

function getCheckedObject(parentId, controlType) {
    var parent = document.getElementById(parentId);
    var cur = parent.firstChild;
    if (controlType == "radio") {
        while (cur != null) {
            if (cur.type == controlType && cur.checked) {
                return cur;
            }
            cur = cur.nextSibling;  // 遍历子节点
        }
        return null;
    }
    if (controlType == "checkbox") {
        var arr = new Array();
        while (cur != null) {
            if (cur.type == controlType && cur.checked) {
                arr.push(cur);
            }
            cur = cur.nextSibling;  // 遍历子节点
        }
        if (arr.length > 0) return arr;
        return null;
    }
}


function getChildCheckboxValues(parentId) {
    var arr = new Array();
    var parent = document.getElementById(parentId);
    var cur = parent.firstChild;
    while (cur != null) {
        if ((cur.type == "checkbox" && cur.checked) || (cur.type == "radio" && cur.checked)) {
            if (!arr.container(cur.value)) arr.push(cur.value);
        }
        childCheckboxValues(cur, arr);
        
        cur = cur.nextSibling;  // 遍历子节点    }
    return arr;
}

function childCheckboxValues(parent, arr) {
    var cur = parent.firstChild;
    while (cur != null) {
        if ((cur.type == "checkbox" && cur.checked) || (cur.type == "radio" && cur.checked)) {
            if (!arr.container(cur.value)) arr.push(cur.value);
        }
        childCheckboxValues(cur, arr);
        
        cur = cur.nextSibling;  // 遍历子节点    }
}




function setObjectsValue(parentId, controlType, val) {
    var arr = getObjects(parentId, controlType);
    for (var i=0; i<arr.length; i++) {
        if (arr[i].value == val) {
            arr[i].checked = true;
        }
    }
}

function showTable(parentId,tableId) {
    var parent = document.getElementById(parentId);
    var table = document.getElementById(tableId);
    
    var cur = parent.firstChild;
    while (cur != null) {
        if (cur.tagName.toUpperCase() == "TABLE")
            cur.style.display = "none";
        cur = cur.nextSibling;  // 遍历子节点
    }
    if (table != null)
        table.style.display = "inline";
}


function getCheckedObjs() {
    var doc = document.getElementById("frmChild").contentWindow.document;
    var objs = doc.getElementsByTagName("INPUT");
    var arr = new Array();
    for (var i=0; i<objs.length; i++) {
        var obj = objs[i];
        if (obj.type == "checkbox" && obj.checked) {
            arr.push(obj.value);
        }
    }
    return arr;
}


function getTableObjs() {
    var doc = document.getElementById("frmChild").contentWindow.document;
    var objs = doc.getElementsByTagName("SPAN");
    var arr = new Array();
    for (var i=0; i<objs.length; i++) {
        var obj = objs[i];
        arr.push(obj.id.replace("span_", ""));
    }
    return arr;
}

    function Qu1(t)
    {
    
      var objForm=document.getElementById("contenForm");
      
      if(objForm.innerHTML=="")
      {
      
            objForm.innerHTML=formHtml;
      }
      var obj=document.getElementById("f");
      document.getElementById("TechID").value=t;
      obj.action="../Person/PersonReport.aspx";
      obj.submit();
      
    
    
    }
    
    
    function Qu2(a,t)
    {
    
      
      var objForm=document.getElementById("contenForm");
      
      if(objForm.innerHTML=="")
      {
      
            objForm.innerHTML=formHtml;
      }
    
      var obj=document.getElementById("f");
      document.getElementById("TechID").value=t;
      document.getElementById("AppID").value=a;
      obj.action="../Person/PersonReportDetail.aspx";
      obj.submit();
   }
   
  